home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16318 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: ns.ftns.no!kether!art
  2. From: art@kether.follonett.no (Arthur Hagen)
  3. Newsgroups: comp.sys.sgi.apps,comp.lang.c++
  4. Subject: Re: SGI's C++ compiler and the boolean type
  5. Date: 10 Apr 1996 11:36:31 GMT
  6. Organization: Interactive Design
  7. Message-ID: <4kg6fv$h7k@nic.ftns.no>
  8. References: <4kefm7$oao@ncar.ucar.edu>
  9. Reply-To: art@mother.idg.no
  10. NNTP-Posting-Host: kether.follonett.no
  11.  
  12.  
  13. In article <4kefm7$oao@ncar.ucar.edu>, jadams@sage.cgd.ucar.edu writes:
  14.  
  15. ...
  16. > get all kinds of compiler errors whenever it encounters "bool", "true",
  17. > or "false" in my codes.  The only workaround I've been able to come up
  18. > with is to include the following lines in my header file:
  19. > typedef int     bool;
  20. > #define true    1
  21. > #define false   0
  22.  
  23. And some argue that true should be -1, because then bitwise not works:
  24.  
  25. ~(true = -1) == (false = 0)
  26. ~(false = 0) == (true = -1)
  27.  
  28. --
  29. Arthur Hagen, Sysadmin, Interactive Design
  30. Business: art@design.idg.no / http://www.design.idg.no/
  31. Personal: art@mother.idg.no / http://mother.idg.no/~art/
  32. Flames: billg@microsoft.com / http://127.0.0.1/
  33.